import request from "@/utils/request";
//用户管理
export const reqUserList = (page = 1, limit = 5) => {
  return request.get(`/admin/acl/user/${page}/${limit}`);
};
//添加和更新
export const reqUpdateUser = (user) => {
  if (!user.id) {
    console.log("user", user);
    delete user.id;
    return request.post("/admin/acl/user/save", user);
  } else {
    return request.put("/admin/acl/user/update", user);
  }
};
//删除
export const reqDelete = (id) => {
  return request.delete(`/admin/acl/user/remove/${id}`);
};
//批量删除
export const reqDeleteList = (data) => {
  return request.post(`/admin/acl/user/batchRemove`, data);
};
//获取信息
export const reqRoleList = (userId) => {
  return request.get(`/admin/acl/user/toAssign/${userId}`);
};
//保存选中
export const reqCheckRole = (data) => {
  console.log(data);

  return request.post(`/admin/acl/user/doAssign`, {}, { params: data });
};
